// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package pica.core;

import java.io.PrintStream;
import java.util.*;

// Referenced classes of package pica.core:
//            b, c, d, f, 
//            g

final class a
{

    a(g g1)
    {
        a = g1;
    }

    public final void a(c c1, String s1)
        throws Exception
    {
        if(s1.equals("cache"))
            a.a(true);
        if(s1.equals("logout"))
            a.a.a(39, null);
        do
        {
            if(c1.a() != 2)
                break;
            String s2;
            if((s2 = c1.b()) == null)
                return;
            if(s2.equals("jabber"))
                b(c1, s1);
        } while(true);
    }

    private void b(c c1, String s1)
        throws Exception
    {
        while(c1.a() == 2) 
        {
            String s2;
            if((s2 = c1.b()) == null)
                return;
            if(s2.equals("sid"))
            {
                if(!a.b())
                    a.a(b(c1));
                else
                    a(c1);
            } else
            {
                if(s2.equals("jerror"))
                {
                    String s3 = c1.a("code");
                    String s4 = b(c1);
                    a.a.a(18, new String[] {
                        s3, s4
                    });
                    a.a(null);
                    a.b(s4);
                    throw new Exception(s4);
                }
                if(s2.equals("message"))
                {
                    if(s1.equals("cache"))
                        a.a(false);
                    c(c1);
                } else
                if(s2.equals("presence"))
                {
                    if(s1.equals("cache"))
                        a.a(false);
                    p(c1);
                } else
                if(s2.equals("iq"))
                {
                    if(s1.equals("cache"))
                        a.a(false);
                    j(c1);
                } else
                {
                    a(c1);
                }
            }
        }
    }

    private void a(c c1)
        throws Exception
    {
        do
        {
            int i1;
            if((i1 = c1.a()) == 3)
                break;
            if(i1 == 2)
                a(c1);
        } while(true);
    }

    private static String b(c c1)
        throws Exception
    {
        String s1 = c1.b();
        StringBuffer stringbuffer = new StringBuffer("");
        for(int i1 = c1.a(); !s1.equals(c1.b()); i1 = c1.a())
            if(i1 == 4)
                stringbuffer.append(c1.c());

        return stringbuffer.toString();
    }

    private static Date a(String s1)
    {
        Date date = null;
        try
        {
            Calendar calendar;
            (calendar = Calendar.getInstance()).set(1, Integer.parseInt(s1.substring(0, 4)));
            calendar.set(2, Integer.parseInt(s1.substring(4, 6)) - 1);
            calendar.set(5, Integer.parseInt(s1.substring(6, 8)));
            calendar.set(11, Integer.parseInt(s1.substring(9, 11)));
            calendar.set(12, Integer.parseInt(s1.substring(12, 14)));
            calendar.set(13, Integer.parseInt(s1.substring(15, 16)));
            calendar.set(14, 0);
            date = calendar.getTime();
        }
        catch(Exception _ex)
        {
            date = new Date();
        }
        return date;
    }

    private void c(c c1)
        throws Exception
    {
        String s1 = c1.a("from");
        String s2 = c1.a("name");
        String s3 = c1.a("list");
        String s4 = c1.a("type");
        String s5 = null;
        String s6 = null;
        String s7 = null;
        String s8 = null;
        String s9 = null;
        String s10 = null;
        String s11 = null;
        Vector vector = new Vector();
        Date date = null;
        String as[][] = (String[][])null;
        boolean flag = true;
label0:
        do
        {
            if(c1.a() != 2)
                break;
            if(s4 == null || !s4.equals("error"))
            {
                String s12;
                if((s12 = c1.b()).equals("body"))
                {
                    s7 = b(c1);
                    continue;
                }
                if(s12.equals("ext"))
                {
                    do
                    {
label1:
                        do
                            do
                            {
                                do
                                {
                                    if(c1.a() != 2)
                                        continue label0;
                                    if(!c1.b().equals("source"))
                                        break;
                                    s9 = c1.a("from");
                                    s10 = c1.a("name");
                                    s11 = c1.a("value");
                                } while(true);
                                if(!c1.b().equals("addbuddy"))
                                    continue label1;
                                s9 = c1.a("from");
                                while(c1.a() == 2) 
                                    if(c1.b().equals("a"))
                                    {
                                        String s13 = c1.a("name");
                                        String s16 = c1.a("zwpurl");
                                        String s18 = c1.a("weburl");
                                        vector.addElement(new String[] {
                                            s13, s16, s18
                                        });
                                        c1.a();
                                    }
                            } while(true);
                        while(!c1.b().equals("notify"));
                        while(c1.a() == 2) 
                            if(c1.b().equals("a"))
                            {
                                String s14 = c1.a("name");
                                String s17 = c1.a("zwpurl");
                                String s19 = c1.a("weburl");
                                vector.addElement(new String[] {
                                    s14, s17, s19
                                });
                                c1.a();
                            }
                    } while(true);
                } else
                {
                    String s15;
                    if(s12.equals("thread"))
                        s5 = b(c1);
                    else
                    if(s12.equals("subject"))
                        s6 = b(c1);
                    else
                    if(s12.equals("x"))
                    {
                        if((s15 = c1.a("xmlns")).equals("pica:form"))
                            as = d(c1);
                        else
                        if(s15 == null)
                            a(c1);
                        else
                        if(s15.equals("jabber:x:roster"))
                            flag = false;
                        else
                        if(s15.equals("jabber:x:oob"))
                            while(c1.a() == 2) 
                                if(c1.b().equals("url"))
                                    s8 = b(c1);
                                else
                                    a(c1);
                        else
                        if(s15.equals("jabber:x:delay"))
                        {
                            date = a(c1.a("stamp"));
                            a(c1);
                        } else
                        {
                            a(c1);
                        }
                    } else
                    {
                        a(c1);
                    }
                    continue;
                }
            }
            a(c1);
        } while(true);
        if(flag && (s4 == null || !s4.equals("error")))
        {
            if(s8 == null || s8.indexOf("sequence_id=0") == -1)
            {
                System.out.println("extName = " + s10 + ", extFrom = " + s9 + ", extValue = " + s11);
                if(s10 != null)
                    s2 = s10;
                a.b.a(s1, s3, s4, s6, s7, s8, date, as, s5, s2, s9, s11, vector);
            }
            a.a.a(5, null);
        }
    }

    private static String[][] d(c c1)
        throws Exception
    {
        Vector vector = new Vector();
        for(; c1.a() == 2 && c1.b().equals("option"); c1.a())
        {
            String s1 = null;
            String s2 = null;
            s1 = c1.a("name");
            s2 = c1.a("value");
            vector.addElement(new String[] {
                s1, s2
            });
        }

        String as[][] = new String[vector.size()][2];
        vector.copyInto(as);
        return as;
    }

    private void e(c c1)
        throws Exception
    {
        String s1 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("CATEGORY"))
                s1 = b(c1);
            else
                a(c1);
        Vector vector = new Vector();
        int i1;
        for(; s1.indexOf(";") != -1; s1 = s1.substring(i1 + 1))
        {
            i1 = s1.indexOf(";");
            vector.addElement(s1.substring(0, i1));
        }

        vector.addElement(s1);
        String as[] = new String[vector.size()];
        vector.copyInto(as);
        a.a.a(25, as);
    }

    private void f(c c1)
        throws Exception
    {
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("name");
                String s3 = c1.a("online");
                String s4 = "";
                while(c1.a() == 2) 
                    if(c1.b().equals("group"))
                        s4 = b(c1);
                    else
                        a(c1);
                a.b.a(s1, s2, s4, s3);
            } else
            {
                a(c1);
            }
        a.a.a(24, null);
    }

    private void g(c c1)
        throws Exception
    {
        Object obj = null;
        Object obj1 = null;
        Object obj2 = null;
        Object obj3 = null;
        String s5 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("name");
                String s3 = c1.a("online");
                String s4 = c1.a("subscription");
                while(c1.a() == 2) 
                    if(c1.b().equals("group"))
                        s5 = b(c1);
                    else
                        a(c1);
                a.b.a(s1, s2, s5, s3, s4);
                a.h(s1, "online");
            } else
            {
                a(c1);
            }
        a.a.a(26, null);
    }

    private void c(c c1, String s1)
        throws Exception
    {
        for(int i1 = c1.a(); i1 == 2; i1 = c1.a())
            if(c1.b().equals("item"))
            {
                c1.a("type");
                String s2 = c1.a("jid");
                String s3 = c1.a("name");
                String s4 = c1.a("subscription");
                String s5 = c1.a("ask");
                String s6 = c1.a("cast");
                String s7 = "";
                s2 = s2.indexOf('/') != -1 ? s2.substring(0, s2.indexOf('/')) : s2;
                while(c1.a() == 2) 
                    if(c1.b().equals("group"))
                        s7 = b(c1);
                    else
                        a(c1);
                if(s4 != null && s4.equals("remove"))
                {
                    a.b.e(s2);
                    continue;
                }
                if((s5 == null || !s5.equals("subscribe")) && s4 != null && (s4.equals("from") || s4.equals("none")) || s5 != null && s5.equals("unsubscribe"))
                    continue;
                byte byte0 = 4;
                if(s5 != null && s5.equals("subscribe"))
                    byte0 = 3;
                byte byte1 = 4;
                if(s7.equals("\u6211\u7684\u597D\u53CB") || s7.equals(""))
                    byte1 = 1;
                a.b.a(s2, byte0, s3, 0, s6, s7, byte1);
            } else
            {
                a(c1);
            }

        a.a.a(8, null);
    }

    private void h(c c1)
        throws Exception
    {
        String s1 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("username"))
                b(c1);
            else
            if(c1.b().equals("password"))
                s1 = b(c1);
            else
                a(c1);
        a.b.b = s1;
        a.a.p();
        a.a.a(17, s1);
    }

    private void i(c c1)
        throws Exception
    {
        Object obj = null;
        Object obj1 = null;
        String s3 = null;
        Object obj2 = null;
        String s5 = null;
        String s6 = null;
        Object obj3 = null;
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("name");
                String s7 = c1.a("buddyview");
                String s4 = c1.a("type");
                s1 = s1.indexOf('/') != -1 ? s1.substring(0, s1.indexOf('/')) : s1;
                Vector vector = new Vector();
label0:
                do
                {
                    if(c1.a() != 2)
                        break;
                    if(c1.b().equals("group"))
                    {
                        s3 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("x"))
                    {
                        s6 = c1.a("type");
                        s5 = c1.a("ztype");
                        do
                        {
                            do
                                if(c1.a() != 2)
                                    continue label0;
                            while(!c1.b().equals("option"));
                            String s8 = c1.a("name");
                            String s9 = c1.a("value");
                            String s10 = c1.a("to");
                            c1.a();
                            vector.addElement(new String[] {
                                s6, s8, s9, s10
                            });
                        } while(true);
                    }
                    a(c1);
                } while(true);
                String as[][] = new String[vector.size()][4];
                vector.copyInto(as);
                if(s3.equals("PICA\u7A7A\u95F4"))
                    a.b.b(s1, s2, s3, as, s4, s6, s5);
                else
                if(s7 == null || s7.equals("0"))
                    a.b.a(s1, s2, s3, as, s4, s6, s5);
                else
                    a.b.b(s1, s2, s3, as, s4, s6, s5);
            } else
            {
                a(c1);
            }
        a.a.a(19, null);
    }

    private String j(c c1)
        throws Exception
    {
        String s1 = c1.a("type");
        String s2 = c1.a("id");
        String s3 = c1.a("from");
        String s4 = c1.a("to");
        if(s1.equals("error"))
            while(c1.a() == 2) 
                if(c1.b().equals("error"))
                {
                    String s5 = c1.a("code");
                    String s7 = b(c1);
                    a.a.a(18, new String[] {
                        s5, s7
                    });
                } else
                {
                    a(c1);
                }
        else
        if(s1.equals("result") && s2 != null && s2.equals("auth"))
            a(c1);
        else
            do
            {
                if(c1.a() != 2)
                    break;
                String s6;
                if(c1.b().equals("query"))
                {
                    if((s6 = c1.a("xmlns")) == null || s6.length() == 0)
                        a(c1);
                    else
                    if(s6.equals("jabber:iq:roster"))
                        c(c1, s1);
                    else
                    if(s6.equals("jabber:iq:version"))
                        while(c1.a() == 2) 
                            a(c1);
                    else
                    if(s6.equals("vcard-temp"))
                    {
                        if(s1.equals("set"))
                            a(c1, s4, s3, true);
                        else
                            a(c1, s4, s3, false);
                    } else
                    if(s6.equals("jabber:iq:newsearch"))
                        n(c1);
                    else
                    if(s6.equals("jabber:iq:blacklist"))
                        o(c1);
                    else
                    if(s6.equals("jabber:iq:picazone"))
                        i(c1);
                    else
                    if(s6.equals("jabber:iq:register") && s1.equals("set"))
                        h(c1);
                    else
                    if(s6.equals("jabber:iq:newgroup"))
                        m(c1);
                    else
                    if(s6.equals("pica:cast:casturl"))
                        l(c1);
                    else
                    if(s6.equals("pica:cluster:roomlist") || s6.equals("pica:game:roomlist"))
                        f(c1);
                    else
                    if(s6.equals("pica:cluster:clusterlist"))
                        g(c1);
                    else
                    if(s6.equals("pica:cluster:role") || s6.equals("pica:game:role"))
                        q(c1);
                    else
                    if(s6.equals("pica:cluster:category"))
                        e(c1);
                    else
                    if(s6.equals("pica:cluster:join"))
                        s(c1);
                    else
                    if(s6.equals("pica:cluster:bulletin"))
                        r(c1);
                    else
                    if(s6.equals("jabber:cluster:roster"))
                        t(c1);
                    else
                        a(c1);
                } else
                if(c1.b().equals("vcard"))
                    a(c1, s4, s3, false);
                else
                if(c1.b().equals("item"))
                {
                    if((s6 = c1.a("xmlns")) == null || s6.length() == 0)
                        a(c1);
                    else
                    if(s6.equals("jabber:iq:browse"))
                        f(c1);
                } else
                if(c1.b().equals("x"))
                {
                    if((s6 = c1.a("xmlns")).equals("jabber:x:config"))
                        k(c1);
                } else
                {
                    a(c1);
                }
            } while(true);
        return s2;
    }

    private void k(c c1)
        throws Exception
    {
        while(c1.a() == 2) 
            if(c1.b().equals("http"))
                b(c1);
            else
            if(c1.b().equals("castbase"))
                a.b.k = b(c1);
            else
                a(c1);
    }

    private void l(c c1)
        throws Exception
    {
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("casturl");
                a.a.a(20, s1 + "username=" + a.b.a + "&password=" + a.b.b);
            } else
            {
                a(c1);
            }
    }

    private void m(c c1)
        throws Exception
    {
        String s1 = "";
        String s2 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                s1 = c1.a("oldgroup");
                s2 = c1.a("newgroup");
            } else
            {
                a(c1);
            }
        Object aobj[];
        (aobj = a.b.y().a(s1, (byte)4))[1] = s2;
        a.a.a(8, null);
    }

    private void n(c c1)
        throws Exception
    {
        byte byte0 = 0;
        for(int i1 = c1.a(); i1 == 2; i1 = c1.a())
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = "";
                String s3 = "";
                String s4 = "";
                String s5 = "";
                String s6 = "";
                String s7 = "";
                String s8 = "";
                String s9 = "";
                String s10 = "";
                String s11 = "";
label0:
                for(i1 = c1.a(); i1 == 2; i1 = c1.a())
                {
                    if(c1.b().equals("NICKNAME"))
                    {
                        s5 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("ADR"))
                        do
                        {
                            if(c1.a() != 2)
                                continue label0;
                            if(c1.b().equals("PCODE"))
                                s2 = b(c1);
                            else
                            if(c1.b().equals("REGION"))
                                s4 = b(c1);
                            else
                                a(c1);
                        } while(true);
                    if(c1.b().equals("ROLE"))
                    {
                        s3 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("ICON"))
                    {
                        s6 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("DESC"))
                    {
                        s8 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("ONLINE"))
                    {
                        s7 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("CATEGORY"))
                    {
                        s9 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("OWNER"))
                    {
                        s10 = b(c1);
                        continue;
                    }
                    if(c1.b().equals("AUTH"))
                        s11 = b(c1);
                    else
                        a(c1);
                }

                byte byte1;
                try
                {
                    byte1 = Byte.parseByte(s6);
                }
                catch(Exception _ex)
                {
                    byte1 = 0;
                }
                boolean flag = s7.equals("yes");
                if(s1.indexOf("@pica") != -1)
                {
                    byte0 = 1;
                    a.b.a(s1, s5, s2, s3, s4, byte1, flag);
                    continue;
                }
                if(s1.indexOf("@cluster.pica") != -1)
                {
                    byte0 = 2;
                    a.b.a(s1, s5, s10, s9, s11, s8);
                }
            } else
            {
                a(c1);
            }

        if(byte0 == 0)
        {
            a.a.a(50, null);
            return;
        }
        if(byte0 == 1)
        {
            a.a.a(27, null);
            return;
        }
        if(byte0 == 2)
            a.a.a(28, null);
    }

    private void o(c c1)
        throws Exception
    {
        int i1 = c1.a();
        do
        {
            if(i1 != 2)
                break;
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("status");
                s1 = s1.indexOf('/') != -1 ? s1.substring(0, s1.indexOf('/')) : s1;
                if(s2.equals("block"))
                    a.b.a(s1, (byte)1, s1.substring(0, s1.indexOf("@")), 0, "", "\u9ED1\u540D\u5355", (byte)2);
                else
                    a.b.e(s1);
            } else
            {
                a(c1);
            }
            if((i1 = c1.a()) == 3)
                i1 = c1.a();
        } while(true);
        a.a.a(8, null);
    }

    private void p(c c1)
        throws Exception
    {
        String s1 = c1.a("from");
        String s2 = c1.a("type");
        c1.a("to");
        String s3 = "";
        String s4 = null;
        String s5 = "";
        Object obj = null;
        Object obj1 = null;
        String s8 = "";
        String s9 = "";
        String s10 = "";
        String s11 = "";
        String s12 = "";
        String s13 = "";
        String s14 = "";
        String s15 = "";
        String s16 = "";
        String s17;
        String s18;
        while(c1.a() == 2) 
            if((s17 = c1.b()).equals("status"))
                s3 = b(c1);
            else
            if(s17.equals("name"))
                s11 = b(c1);
            else
            if(s17.equals("role"))
                s8 = b(c1);
            else
            if(s17.equals("speak"))
                s9 = b(c1);
            else
            if(s17.equals("prvtmsg"))
                s10 = b(c1);
            else
            if(s17.equals("icon"))
                s5 = b(c1);
            else
            if(s17.equals("error"))
            {
                if(s2.equals("error"))
                {
                    String s6 = c1.a("code");
                    String s7 = b(c1);
                    a.a.a(18, new String[] {
                        s6, s7
                    });
                } else
                {
                    a(c1);
                }
            } else
            if(s17.equals("show"))
                s4 = b(c1);
            else
            if(s17.equals("x"))
            {
                if((s18 = c1.a("xmlns")) == null || s18.length() == 0)
                    a(c1);
                else
                if(s18.equals("http://jabber.org/protocol/muc"))
                    a(c1);
                else
                if(s18.equals("jabber:x:delay"))
                    a(c1);
                else
                    a(c1);
            } else
            if(s17.equals("roomid"))
                a.b.C = b(c1);
            else
            if(s17.equals("unibrew"))
                s12 = b(c1);
            else
            if(s17.equals("v_msg"))
                s13 = b(c1);
            else
            if(s17.equals("v_stream"))
                s14 = b(c1);
            else
            if(s17.equals("pc"))
                s15 = b(c1);
            else
            if(s17.equals("wap"))
                s16 = b(c1);
            else
                a(c1);
        if(s2 != null && s2.equals("error"))
        {
            if(s1.indexOf("cluster") == -1)
            {
                a.a(s1, null, null, "remove");
                return;
            }
        } else
        {
            if(s1.indexOf("@cluster.pica") != -1 || s1.indexOf("@game.pica") != -1)
            {
                int i1 = 0;
                Object aobj3[];
                try
                {
                    i1 = Integer.parseInt(s5);
                }
                catch(Exception _ex)
                {
                    if((aobj3 = a.b.c(s1)) != null)
                        i1 = ((Integer)aobj3[5]).intValue();
                }
                if(s2 != null && s2.length() > 0)
                {
                    if(s2.equals("unavailable"))
                        if(a.b.E)
                        {
                            if(a.b.a.equals(s1.substring(0, s1.indexOf("%"))))
                            {
                                a.b.B = null;
                                a.b.D = null;
                                a.b.n().a();
                                a.b.A.removeAllElements();
                                a.a.a(38, null);
                            } else
                            {
                                Object aobj[];
                                if((aobj = a.b.c(s1)) != null)
                                    a.b.n().a(((Object) (aobj)));
                                a.a.a(36, null);
                            }
                        } else
                        {
                            Object aobj1[];
                            if((aobj1 = a.b.c(s1)) != null)
                                if(s8.equals("none"))
                                {
                                    a.b.n().a(((Object) (aobj1)));
                                } else
                                {
                                    aobj1[4] = s8;
                                    aobj1[6] = "exit";
                                    aobj1[2] = new Byte((byte)1);
                                }
                            a.a.a(36, null);
                        }
                } else
                if(s4 != null && s4.equals("leave"))
                {
                    if(s1.indexOf('%') != -1 && s1.substring(0, s1.indexOf("%")).equals(a.b.a))
                    {
                        a.b.B = null;
                        a.b.D = null;
                        a.b.n().a();
                        a.b.A.removeAllElements();
                        a.a.a(38, null);
                    } else
                    {
                        String s19 = s1;
                        Object aobj4[];
                        if((aobj4 = a.b.c(s19)) != null)
                        {
                            aobj4[4] = s8;
                            aobj4[6] = "leave";
                            aobj4[2] = new Byte((byte)2);
                        } else
                        {
                            a.b.a(s19, s11, s8, i1, "leave");
                        }
                        a.a.a(36, null);
                    }
                } else
                if(s4 != null && s4.equals("online"))
                {
                    String s20 = s1;
                    Object aobj5[];
                    if((aobj5 = a.b.c(s20)) != null)
                    {
                        aobj5[4] = s8;
                        aobj5[6] = "leave";
                        aobj5[2] = new Byte((byte)2);
                    } else
                    {
                        a.b.a(s20, s11, s8, i1, "leave");
                    }
                    a.a.a(36, null);
                } else
                if(s4 == null || !s4.equals("member"))
                {
                    Object aobj2[];
                    if(a.b.a.equals(s1.substring(0, s1.indexOf("%"))))
                    {
                        a.b.D = s8;
                        s10.equals("yes");
                        s9.equals("yes");
                        if(a.b.c(s1) == null)
                            a.b.a(s1, s11, s8, i1, "enter");
                        a.a.a(37, null);
                    } else
                    if((aobj2 = a.b.c(s1)) != null)
                    {
                        aobj2[3] = s11;
                        aobj2[4] = s8;
                        aobj2[5] = new Integer(i1);
                        aobj2[6] = "enter";
                        aobj2[2] = new Byte((byte)3);
                    } else
                    if(s4 == null)
                        a.b.a(s1, s11, s8, i1, "leave");
                    else
                        a.b.a(s1, s11, s8, i1, "enter");
                    a.a.a(36, null);
                }
                return;
            }
            int j1 = 0;
            try
            {
                j1 = Integer.parseInt(s5);
            }
            catch(Exception _ex) { }
            String s21 = s1.indexOf('/') != -1 ? s1.substring(0, s1.indexOf('/')) : s1;
            Object aobj6[] = a.b.a(s21);
            if(s2 != null && s2.equals("subscribe"))
            {
                if(((Byte)a.b.k()[1]).byteValue() == 0 && aobj6 == null)
                    a.b.Q.addElement(new String[] {
                        s21, s3
                    });
                a.a.a(21, s21);
                return;
            }
            if((s2 == null || !s2.equals("unsubscribe")) && aobj6 != null)
            {
                if(s2 != null && s2.equals("unsubscribed"))
                {
                    a.b.e((String)aobj6[1]);
                    String s22 = s21.indexOf('@') != -1 ? s21.substring(0, s21.indexOf('@')) : s21;
                    if(s3 != null && s3.toLowerCase().equals("not found"))
                        a.a.a(23, "PICA\u53F7" + s22 + "\u4E0D\u5B58\u5728\uFF01");
                    if(((Byte)aobj6[2]).byteValue() == 3 && !s3.toLowerCase().equals("autoreply") && !s3.toLowerCase().equals("not found"))
                        a.a.a(23, "\u7528\u6237" + s22 + "\u62D2\u7EDD\u4E86\u4F60\u7684\u9A8C\u8BC1\u8BF7\u6C42\uFF01");
                } else
                {
                    byte byte0 = ((Byte)aobj6[2]).byteValue();
                    if(s4 == null)
                        byte0 = 7;
                    else
                    if(s4.equals("dnd"))
                        byte0 = 6;
                    else
                    if(s4.equals("away") || s4.equals("xa"))
                        byte0 = 5;
                    else
                    if(s4.equals("iv"))
                        byte0 = 4;
                    if(s2 != null && (s2.equals("unavailable") || s2.equals("unsubscribed")))
                        byte0 = 4;
                    byte byte1 = 3;
                    if(s15.equals("yes"))
                        byte1 = 4;
                    else
                    if(s16.equals("yes"))
                        byte1 = 5;
                    else
                    if(s12.equals("yes"))
                        byte1 = 2;
                    else
                    if(s13.equals("yes") || s14.equals("yes"))
                        byte1 = 1;
                    a.b.a(s21, byte0, j1, byte1);
                }
                a.a.a(8, null);
            }
        }
    }

    private void a(c c1, String s1, String s2, boolean flag)
        throws Exception
    {
        String s3 = "";
        String s4 = "";
        String s5 = "";
        String s6 = "";
        String s7 = "";
        String s8 = "";
        String s9 = "";
        String s10 = "";
        String s11 = "";
        String s12 = "";
        String s13 = "";
        String s14 = "";
        String s15 = "";
        String s16 = "";
        String s17 = "";
        String s18 = "";
        String s19 = "";
        String s20 = "";
        String s21 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("FN"))
                s8 = b(c1);
            else
            if(c1.b().equals("NICKNAME"))
                s3 = b(c1);
            else
            if(c1.b().equals("TEL"))
                s4 = b(c1);
            else
            if(c1.b().equals("ROLE"))
                s6 = b(c1);
            else
            if(c1.b().equals("ADR"))
                while(c1.a() == 2) 
                    if(c1.b().equals("PCODE"))
                        s5 = b(c1);
                    else
                    if(c1.b().equals("REGION"))
                        s7 = b(c1);
                    else
                        a(c1);
            else
            if(c1.b().equals("RANK"))
                s20 = b(c1);
            else
            if(c1.b().equals("RANK_NAME"))
                s21 = b(c1);
            else
            if(c1.b().equals("EMAIL"))
                s9 = b(c1);
            else
            if(c1.b().equals("TITLE"))
                s10 = b(c1);
            else
            if(c1.b().equals("DESC"))
                s11 = b(c1);
            else
            if(c1.b().equals("ICON"))
                s12 = b(c1);
            else
            if(c1.b().equals("OLD_NUMBER"))
                b(c1);
            else
            if(c1.b().equals("X_SECURITY_NUMBER"))
                s13 = b(c1);
            else
            if(c1.b().equals("CATEGORY"))
                s14 = b(c1);
            else
            if(c1.b().equals("OWNER"))
                s15 = b(c1);
            else
            if(c1.b().equals("AUTH"))
                s16 = b(c1);
            else
            if(c1.b().equals("SEX"))
                s17 = b(c1);
            else
            if(c1.b().equals("TELEPHONE"))
                s18 = b(c1);
            else
            if(c1.b().equals("SPEAK"))
                s19 = b(c1);
            else
                a(c1);
        if(s13 != null && s13.length() > 0)
        {
            a.a.a(16, s13);
            return;
        }
        s2 = s2.indexOf('/') != -1 ? s2.substring(0, s2.indexOf('/')) : s2;
        s1 = s1.indexOf('/') != -1 ? s1.substring(0, s1.indexOf('/')) : s1;
        if(flag)
        {
            String s22 = s2.indexOf('%') != -1 ? s2.substring(0, s2.indexOf('%')) : s2;
            String s24 = null;
            if(s1 != null)
                s24 = s1.indexOf("@pica") != -1 ? s1.substring(0, s1.indexOf("@pica")) : s1;
            if(a.b.B != null && s2.equals(a.b.B))
            {
                a.b.K = s3;
                a.b.L = s14;
                a.b.M = s15;
                a.b.N = s16;
                a.b.O = s11;
                a.b.P = s19;
                a.a.a(33, null);
            } else
            if(s22 != null && s22.length() > 0 && s22.equals(s24))
            {
                a.b.F = s3;
                a.b.G = s17.equals("M") ? "\u7537" : "\u5973";
                a.b.H = s18;
                a.b.I = s9;
                a.b.J = s11;
                a.a.a(34, null);
            } else
            {
                a.b.F = s3;
                a.b.n = s3;
                a.b.o = s8;
                a.b.p = s4;
                a.b.q = s6;
                a.b.r = s5;
                a.b.s = s7;
                a.b.t = s9;
                a.b.u = s10;
                a.b.v = s11;
                try
                {
                    a.b.y = (byte)Integer.parseInt(s12);
                }
                catch(Exception _ex)
                {
                    a.b.y = 0;
                }
                if(a.b.y < 0 || a.b.y > 8)
                    a.b.y = 0;
                a.a.a(35, null);
            }
            return;
        }
        if(s2.equals(s1))
        {
            a.b.F = s3;
            a.b.n = s3;
            a.b.o = s8;
            a.b.p = s4;
            a.b.q = s6;
            a.b.r = s5;
            a.b.s = s7;
            a.b.t = s9;
            a.b.u = s10;
            a.b.v = s11;
            a.b.w = s21;
            a.b.x = s20;
            try
            {
                a.b.y = (byte)Integer.parseInt(s12);
            }
            catch(Exception _ex)
            {
                a.b.y = 0;
            }
            if(a.b.y < 0 || a.b.y > 8)
                a.b.y = 0;
            a.f("available", null);
            a.a.a(9, null);
            return;
        }
        if(s2.indexOf("@cluster.pica") != -1)
        {
            String s23 = s2.indexOf('%') != -1 ? s2.substring(0, s2.indexOf('%')) : s2;
            String s25 = null;
            if(s1 != null)
                s25 = s1.indexOf("@pica") != -1 ? s1.substring(0, s1.indexOf("@pica")) : s1;
            if(s25 != null && s25.length() > 0 && s25.equals(s23))
            {
                a.b.F = s3;
                a.b.G = s17.equals("M") ? "\u7537" : "\u5973";
                a.b.H = s18;
                a.b.I = s9;
                a.b.J = s11;
                a.a.a(12, null);
            } else
            if(s2.indexOf("%") != -1 && s25 != null && s25.length() > 0 && !s25.equals(s23) && !s23.equals(a.b.B))
                a.a.a(13, ((Object) (new Object[] {
                    s23, s3, s17.equals("M") ? "\u7537" : "\u5973", s18, s9, s11
                })));
            else
            if(a.b.B != null && s2.equals(a.b.B))
            {
                a.b.K = s3;
                a.b.L = s14;
                a.b.M = s15;
                a.b.N = s16;
                a.b.O = s11;
                a.b.P = s19;
                a.a.a(15, null);
            } else
            {
                a.a.a(14, ((Object) (new Object[] {
                    new Byte((byte)3), s2, s3, s15, s14, s16, s11
                })));
            }
            return;
        }
        if(s5 == null || s5.length() == 0)
            s5 = "\u4FDD\u5BC6";
        if(s6 == null || s6.length() == 0)
            s6 = "\u4FDD\u5BC6";
        if(s7 == null || s7.length() == 0)
            s7 = "\u4FDD\u5BC6";
        if(s11 == null || s11.length() == 0)
            s11 = "\u5929\u5929PICA\uFF0C\u5929\u5929\u597D\u5FC3\u60C5\uFF01";
        if(s2.endsWith("@pica") || s2.endsWith("@qq.pica"))
        {
            byte byte0 = 0;
            try
            {
                byte0 = (byte)Integer.parseInt(s12);
            }
            catch(Exception _ex)
            {
                byte0 = 0;
            }
            a.a.a(10, ((Object) (new Object[] {
                s2, s3, s7, s5, s6, s11, s20, s21, new Byte(byte0)
            })));
            return;
        } else
        {
            a.a.a(11, ((Object) (new Object[] {
                s2, s11
            })));
            return;
        }
    }

    private void q(c c1)
        throws Exception
    {
        while(c1.a() == 2) 
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("role");
                String s3 = c1.a("reason");
                Object aobj[] = a.b.b(s1.substring(s1.indexOf("%") + 1, s1.length()));
                String s4 = null;
                if(s2.equals("none"))
                {
                    if(a.b.E)
                    {
                        if(s1.indexOf("@game.pica") != -1)
                            s4 = "\u4F60\u5DF2\u7ECF\u88AB\u8E22\u51FA\u6E38\u620F\u5927\u5385[" + aobj[4] + "]\uFF0C\u539F\u56E0\uFF1A" + s3;
                        else
                            s4 = "\u4F60\u5DF2\u7ECF\u88AB\u8E22\u51FA\u804A\u5929\u5BA4[" + aobj[4] + "]\uFF0C\u539F\u56E0\uFF1A" + s3;
                    } else
                    {
                        s4 = "\u4F60\u5DF2\u7ECF\u88AB\u5F00\u9664\u51FA\u7FA4[" + aobj[4] + "]\uFF0C\u539F\u56E0\uFF1A" + s3;
                        a.b.f(s1.substring(s1.indexOf("%") + 1, s1.length()));
                    }
                    a.a.a(31, s4);
                } else
                {
                    if(s2.equals("member"))
                        s4 = "\u4F60\u88AB\u8BBE\u4E3A\u7FA4[" + aobj[4] + "]\u7684\u666E\u901A\u6743\u9650\u6210\u5458\uFF01";
                    else
                    if(s2.equals("au-member"))
                        s4 = "\u4F60\u88AB\u8BBE\u4E3A\u7FA4[" + aobj[4] + "]\u7684\u6388\u6743\u6210\u5458\uFF01";
                    else
                    if(s2.equals("admin"))
                        s4 = "\u4F60\u88AB\u8BBE\u4E3A\u7FA4[" + aobj[4] + "]\u7684\u7BA1\u7406\u5458\uFF01";
                    else
                    if(s2.equals("owner"))
                        s4 = "\u7FA4[" + aobj[4] + "]\u88AB\u8F6C\u8BA9\u7ED9\u4F60\uFF0C\u4F60\u73B0\u5728\u662F\u6B64\u7FA4\u7684\u7FA4\u4E3B\uFF01";
                    Object aobj1[];
                    if((aobj1 = a.b.c(s1)) != null)
                        aobj1[4] = s2;
                    a.a.a(32, s4);
                }
                c1.a();
            } else
            {
                a(c1);
            }
    }

    private void r(c c1)
        throws Exception
    {
        String s1 = "";
        while(c1.a() == 2) 
            if(c1.b().equals("body"))
            {
                s1 = b(c1);
                c1.a();
            } else
            {
                a(c1);
            }
        if(s1 != null && s1.length() > 0)
            a.a.a(30, null);
    }

    private void s(c c1)
        throws Exception
    {
        String s1 = "";
        String s2 = "";
        String s3 = "";
        String s4 = "";
        String s5 = "";
        String s6 = null;
        while(c1.a() == 2) 
        {
            if(c1.b().equals("item"))
            {
                s1 = c1.a("jid");
                s2 = c1.a("name");
                s6 = c1.a("status");
                s3 = c1.a("online");
                s4 = c1.a("subscription");
                while(c1.a() == 2) 
                    if(c1.b().equals("group"))
                        s5 = b(c1);
                    else
                        a(c1);
            }
            if(s4 != null)
            {
                if(s4.equals("none"))
                    a.b.f(s1);
                else
                    a.b.a(s1, s2, s5, s3, s4);
            } else
            {
                Object aobj[] = {
                    s1, s2, s6
                };
                a.b.R.addElement(((Object) (aobj)));
                a.a.a(47, null);
            }
        }
    }

    private void t(c c1)
        throws Exception
    {
        Object obj = null;
        Object obj1 = null;
        Object obj2 = null;
        Object obj3 = null;
        for(int i1 = c1.a(); i1 == 2; i1 = c1.a())
            if(c1.b().equals("item"))
            {
                String s1 = c1.a("jid");
                String s2 = c1.a("name");
                String s4 = c1.a("icon");
                String s3 = c1.a("role");
                byte byte0;
                try
                {
                    byte0 = Byte.parseByte(s4);
                }
                catch(Exception _ex)
                {
                    byte0 = 9;
                }
                a.b.a(s1, s2, s3, byte0, "exit");
                c1.a();
            } else
            {
                a(c1);
            }

        a.a.a(29, null);
    }

    private g a;
}
